WDV221 Intro Javascript
Shipping Calculation Project
Calculate Your Order
Select Product:
Please Select a Product
Book
Pen
Pencil
Quantity:
Shipping State (Tax Purposes):
Iowa
Illinois
Indiana
Other
Delivery Method:
Standard UPS - 3 Days
US Mail - 5 Days
Overnight - 1 Day
Pickup
Your Total is:
Project Instructions:
Create a function called getShipping that is called when you click the "Calculate My Order Now" button.
When a product is selected the function should get the price for the selected product and store it in a local variable.
Take the quantity entered on the form and store it in a local variable.
Calculate a salesTotal using price * quantity.
When the taxing state is selected, determine the tax rate based upon the selected state.
Calculate the tax amount on the sales total as taxRate * salesTotal. Store the tax amount in a local variable.
When the Delivery Method is selected the function should get the delivery fee from the selected delivery method.
Determine the shipping cost based upon the selected shipping method.
Determine the total bill by adding the sales total, tax amount and shipping cost. Place the combined amount in the total field
Format the total amount by using a dollar format function.